<template>
  <div class="container">
    <!-- <nav-bar :title="msg + '成功'" :goBack="false" /> -->
    <div class="icon">
      <img src='../../assets/img/success.png' />
    </div>
    <div class="discrib">
      <p>{{msg}}成功</p>
      <p class="back">{{second}}s后跳转页面</p>
    </div>
  </div>
</template>

<script>
import NavBar from 'components/common/NavBar'
export default {
  components: {
    NavBar
  },
  data() {
    return {
      second: 3,
      msg: '',
    }
  },
  mounted() {
    this.msg = this.$route.query.msg || '操作'

    let navigatePage = '/best'
    if(this.$route.query.navigate){
      navigatePage = this.$route.query.navigate
    }
    let st = setInterval(() => {
      if(this.second > 1){
        this.second--
      } else {
        this.$router.push(navigatePage)
        clearInterval(st)
      }
    },1000)
  },
}
</script>

<style scoped>
.container{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
}
.icon img{
  width: 100px;
  height: 100px;
}
.discrib{
  font-size: 18px;
  line-height: 3;
  text-align: center;
}
.back{
  font-size: 12px;
  color: #cccccc;
}
</style>